package com.wk.unreal.yyzxserver.mapper;

import com.wk.unreal.yyzxserver.entity.Menu;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface MenuMapper {

    @Select("SELECT m.* FROM `user` u,rolemenu rm,menu m WHERE u.role_id = #{roleId} AND u.role_id = rm.role_id AND rm.menu = m.id\n")
    public List<Menu> menus(Integer roleId);

    @Select("select * from menu where parent_id = #{id}")
    public List<Menu> childrenMenu(Integer id);
}
